using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace Pong_Xvna
{
    public class Ball : Sprite
    {
        public Ball(Game game,Vector2 pos, Vector2 velo)
            : base(game,pos,velo)
        {
            nTexture2D = 2;
            iTexture2D = 0;
            texture = new Texture2D[nTexture2D];
            
                texture[0] = Game.Content.Load<Texture2D>("GreenBall");
                texture[1] = Game.Content.Load<Texture2D>("OrangeBall");
        }

       
        public override void Initialize()
        {
            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            if (position.Y < 0 || position.Y > 500 - texture[iTexture2D].Height)
                velocity.Y *= -1;

            base.Update(gameTime);
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }
        public override Sprite Clone()
        {
            Sprite sp = new Ball(Game1, new Vector2(30, 330), new Vector2(5, 0));
            return sp;
        }
    }
}